//
//  DetailModel.h
//  jingdongfang
//
//  Created by 郝志宇 on 16/9/8.
//  Copyright © 2016年 ZhiYu Hao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ImMsgDetail.h"

#pragma mark RCMessageDirection - 消息的方向
/*!
 消息的方向
 */
typedef NS_ENUM(NSInteger, MessageType) {
    /*!
     发送
     */
    MessageType_SEND = 1,
    
    /*!
     接收
     */
    MessageType_RECEIVE = 2
};


#pragma mark RCSentStatus - 消息的发送状态
/*!
 消息的发送状态
 */
typedef NS_ENUM(NSUInteger, MessageStatus) {
    /*!
     发送中
     */
    MessageStatus_SENDING = 10,
    
    /*!
     发送失败
     */
    MessageStatus_FAILED = 20,
    
    /*!
     已发送成功
     */
    MessageStatus_SENT = 30,
    
    /*!
     对方已接收
     */
    MessageStatus_RECEIVED = 40,
    
    /*!
     对方已阅读
     */
    MessageStatus_READ = 50,
    
    /*!
     对方已销毁
     */
    MessageStatus_DESTROYED = 60
};

@interface MessageModel : NSObject

@property (nonatomic, copy) NSString *n_id;                 //发送者id
@property (nonatomic, copy) NSString *u_id;                 //接收者id
@property (nonatomic, copy) NSString *name;                 //该条消息的发送者
@property (nonatomic, copy) NSString *image;                //该条消息对应的头像
@property (nonatomic, assign) NSTimeInterval created_at;    //消息时间
@property (nonatomic, assign) NSInteger type;               //消息格式(1.文本加表情;2.图片)
@property (nonatomic, copy) NSString *title;                //消息内容
@property (nonatomic, copy) NSString *imgSmall;             //小图
@property (nonatomic, assign) MessageType messageType;      //  1 me  2 other

@property (nonatomic, assign) MessageStatus messageStatus;  //  1 me  2 other

+ (MessageModel *)convertFrom:(ImMsgDetail *)msgDetail;

@end
